#! /bin/bash




total=24;
a=7;
b=13;

for exe in  2d-jacobi-9p 
do
    rm result/$exe.txt 
    for index in `seq $a $b`;
    do 
    nx=$((2 ** $index))
    t=$((2 ** (total - $a - ($index - $a) * 2)))
    ../$exe/exe-$exe $nx $nx $t >> result/$exe.txt 
    done
done

echo -e "size\tscalar\tauto\tv1\tour\tv3\tspeedup\tspeedup\tspeedup\tspeedup" > result/$exe.data.txt
cat result/2d-jacobi-9p.txt|tr "," "=" | awk -F "= " '{print $3 "\t" $NF}'| paste - - - - -|awk '{print $1"\t" $2"\t" $4"\t" $6"\t"$8"\t"$10"\t"$4/$2"\t"$6/$2"\t"$8/$2"\t"$10/$2}' >> result/$exe.data.txt

